﻿<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/


/*
 * 后台
 * */
/*登录路由*/
Route::group(['prefix'=>"admin",'namespace'=>"Admin"],function(){
    Route::any('login',"LoginController@index");//登录
    Route::get('code',"LoginController@code");//生成验证码
    Route::get('getcode',"LoginController@getCode");//查看验证码的值
    Route::get('outlog',"loginController@outlog");//退出
});
/*其他路由*/
Route::group(['prefix'=>"admin",'namespace'=>"Admin",'middleware'=>["admin.login"]],function(){
    Route::get('/',"IndexController@index");//首页路由
    Route::any('password',"IndexController@password");//修改密码路由
    Route::resource('package','PackageController');//套餐资源路由
    Route::resource('action',"ActionController");//活动资源路由
    Route::get('index', 'IndexController@index');//后台主页
    Route::get('welcome', 'IndexController@welcome');//后台欢迎页面
    //lxy、
    Route::resource('carModel', 'CarModelController');//后台车型资源路由
    Route::resource('brand', 'BrandController');//后台品牌资源路由
    Route::any('upload', 'CommonController@upload'); //上传图片
    Route::get('brand/create/{bid}', 'BrandController@create');//品牌车系 子集添加
    //pb
	Route::resource('car','CarController');//创建汽车表的资源路由
	Route::any('car/upload','CarController@upload');//异步上传图片

    //CTQ
    //后台城市——cc
    Route::resource('city','CityController');
//    Route::get('city','CityController@index');门店——cc
    Route::resource('store','StoreController');

});


/*
 * 前台
 * */
Route::group(['prefix'=>"home",'namespace'=>"Home"],function(){
    //
    Route::get('orderSubmit',"OrderSubmitController@index");//短租订单提交
    Route::get('orderSubmitSuccess',"OrderSubmitSuccessController@index");//短租订单提交成功
    Route::get('waitingPayment',"WaitingPaymentController@index");//顺风车等待付款
    Route::get('reservationSuccess',"ReservationSuccessController@index");//预定成功
    Route::get('determineTrip',"DetermineTripController@index");//顺风车确定路程

});
//前台路由
Route::group(['prefix'=>"index",'namespace'=>"Home"],function(){
    Route::get('shunfeng',"sfcarController@index");//顺风车
    Route::any('sfajax',"sfcarController@index");//
    Route::any('endcity',"sfcarController@selects");//还车城市ajax
    Route::get('shunfeng/sfbook/info/{sfid}',"sfcarController@book");//预定页面
    Route::any('shunfeng/sfbook/sess',"sfcarController@addSESS");
    Route::any('order',"orderController@index");
    Route::get("carinfo/{cid}","carinfoController@index");
});


Route::group(['namespace'=>'Home'],function (){
    Route::get('/','IndexController@index');
    Route::any('index','IndexController@index');
    Route::get('login','LoginController@index');
    Route::post('login1','LoginController@login');
    Route::any('register','LoginController@register');
    Route::get('code','LoginController@code');
    //短租页面路由
    Route::get('duanzu','DuanzuController@index');
    Route::post('duanzu/citystore/{ctid}','DuanzuController@citystore');
    Route::post('duanzu/formdata','DuanzuController@formdata');
    Route::post('duanzu/select','DuanzuController@select');
    Route::post('duanzu/save','DuanzuController@save');
});